package com.suixinsanren.design.observer.demo03;

public class AverageDisplay implements Observer, DisplayWeatherDate {

    private float averageTemp;

    @Override
    public void update(float temp, float humidity, float pressure) {
        this.averageTemp = temp / 2;
        display();
    }

    @Override
    public void display() {
        System.out.println("------来自平均温度版-----");
        System.out.println("平均温度：" + averageTemp);
        System.out.println("------------------------");
    }
}
